package com.company.salarysystem;

// 管理人员类（月薪+奖金计薪）
public class Manager extends Employee {
    private double monthlySalary;  // 月基本工资
    private double bonus;          // 奖金

    public Manager(String name, String empId, double monthlySalary, double bonus) {
        super(name, empId);
        this.monthlySalary = monthlySalary;
        this.bonus = bonus;
    }

    // 计算薪资：月薪 + 奖金
    @Override
    public double calculateSalary() {
        return monthlySalary + bonus;
    }

    // 实现薪资明细：月薪 + 奖金 = 总薪资
    @Override
    public String getSalaryDetails() {
        return monthlySalary + "元（月薪） + " + bonus + "元（奖金） = " + (monthlySalary + bonus) + "元";
    }
}